<?php

require 'app/autoload.php';
require 'app/array.php';
require 'app/lang.php';

class ArrayTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     */
    public function rekeyTest()
    {
        $data = array(
            array('a' => 0, 'b' => 'a'),
            array('a' => 1, 'b' => 'b'),
            array('a' => 2, 'b' => 'c')
        );
        $res = rekey($data, 'b');
        $this->assertEquals(
            $res,
            array(
                'a' => array('a' => 0, 'b' => 'a'),
                'b' => array('a' => 1, 'b' => 'b'),
                'c' => array('a' => 2, 'b' => 'c')
            )
        );
    }
}